<?xml version="1.0" encoding="ISO-8859-1" ?>

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:rich="http://richfaces.org/rich"
	  xmlns:a4j="http://richfaces.org/a4j">
	
	<f:subview id="subviewManterMarca">
		<rich:modalPanel id="manterMarca" autosized="true" headerClass="height:20px;" resizeable="false" >
			<f:facet name="header">
				<h:outputText value="#{bundle.marca_titulo_manter}" />
			</f:facet>
			<f:facet name="controls">
				<h:panelGroup>
					<h:graphicImage value="/images/close.gif" styleClass="botao_fechar_popup" id="hideLink">
						<rich:componentControl for="manterMarca" attachTo="hideLink" operation="hide" event="onclick" />
					</h:graphicImage>
				</h:panelGroup>
			</f:facet>
			<b><font color="red"><rich:messages id="msgMarcaManter"></rich:messages></font></b>
			<a4j:form ajaxSubmit="true" id="formMarcaManter" reRender="marca_codigo, marca_descricao">
				<script type="text/javascript">		
						function valida() {
							if (#{facesContext.maximumSeverity == null}) {
								#{rich:component('manterMarca')}.hide();
							}
						}
				</script>	
                <h:panelGrid columns="2">
                	<h:outputLabel value="#{bundle.marca_codigo}:" for="marca_codigo" />
                    <h:inputText id="marca_codigo" value="#{marcaBackBean.marcaFormBean.marcaManter.codigo}" label="#{bundle.marca_codigo}" readonly="true" disabled="true" size="5" />
                    
                	<h:outputLabel value="#{bundle.marca_descricao}:" style="color:red;"  for="marca_descricao" />
                    <h:inputText id="marca_descricao" value="#{marcaBackBean.marcaFormBean.marcaManter.descricao}" label="#{bundle.marca_descricao}" disabled="#{marcaBackBean.marcaFormBean.isDisabled}" maxlength="30" size="32" />
                </h:panelGrid>
                
                <div class="linha"/>
                
                <a4j:commandButton action="#{marcaBackBean.manterMarca}" value="#{bundle.marca_btn_gravar}" oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('manterMarca')}.hide(); " reRender="formMarcaConsulta,formMarcaPopup" disabled="#{marcaBackBean.marcaFormBean.isDisabled}"/>
	            <a4j:commandButton action="#{marcaBackBean.excluirMarca}" value="#{bundle.marca_btn_excluir}" id="btnExcluir" reRender="formMarcaConsulta,formMarcaManter" disabled="#{!marcaBackBean.marcaFormBean.isDisabled}" oncomplete="javascript:valida();" />
                <a4j:commandButton value="#{bundle.marca_btn_voltar}" id="btnVoltar" reRender="gridMarca" >
                	<rich:componentControl for="manterMarca" attachTo="btnVoltar" operation="hide" event="onclick" />
                </a4j:commandButton>
					
			</a4j:form>

		 <div class="linha"/>
			<h:outputLabel value="#{bundle.campos_obrigatorios}" style="color:red;"/> 
		</rich:modalPanel>
	</f:subview>

</html>